import java.awt.*;
import java.util.Random;
import java.lang.Math;
@SuppressWarnings("serial")
public class Terrain extends Canvas {
	Graphics gr;
	private int[] xPontok;
	private int[] yPontok;
	private int pontSzam;

	Terrain() {

		this.setBackground(new Color(128, 217, 217));
		int hossz, magas;
		
		pontSzam = 20;
		xPontok = new int[100];
		yPontok = new int[100];
		hossz = 1200/pontSzam;
		magas = 450;
		
		
		for (int i = 0; i < pontSzam; i++) {

			xPontok[i] = i * hossz;
			yPontok[i] = (int) (Math.sin(i)*100+400);
			System.out.println(i+"-"+xPontok[i]+" nel "+(yPontok[i]-400));
		}

		
	}
		public void paint (Graphics gr){
			gr.setColor(Color.BLACK);
			gr.fillPolygon(xPontok, yPontok, pontSzam);
			gr.fillRect(0, 400, 1200, 450);
		}
	public int randomom(int n) {
		Random generator = new Random();
		int r1 = generator.nextInt(n);

		return r1;
	}
}
